//
//  MenuRightCell.m
//  EducationAdminClient
//
//  Created by 孙添凤 on 16/9/27.
//  Copyright © 2016年 周佳兴. All rights reserved.
//

#import "MenuRightCell.h"
#import "Masonry.h"
@implementation MenuRightCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    //    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    if (self) {
        UIView *view = [self createUI];
        [self.contentView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left);
            make.right.equalTo(self.contentView.mas_right);
            make.height.equalTo(self.contentView.mas_height);
            make.bottom.equalTo(self.contentView.mas_bottom);
        }];
        
        
    }
    return self;
}

-(UIView *)createUI{
    UIView *baseView = [[UIView alloc]init];
    baseView.backgroundColor =[UIColor whiteColor];
    
    _v1 =[[UIView alloc]init];
    [baseView addSubview:_v1];
   [_v1 mas_makeConstraints:^(MASConstraintMaker *make) {
       make.centerX.equalTo(baseView.mas_centerX).offset(-40-5);
       make.top.equalTo(baseView.mas_top).offset(5);
       make.height.equalTo(@(80));
       make.width.equalTo(@(80));
   }];
    _v1.backgroundColor =[UIColor yellowColor];
    
    _img1 =[[UIImageView alloc]init];
    [_v1 addSubview:_img1];
    [_img1 sizeToFit];
    [_img1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(_v1.mas_centerX);
        make.top.equalTo(_v1.mas_top).offset(10);
        make.height.equalTo(@(25));
        make.width.equalTo(@(25));
    }];
    _img1.image =[UIImage imageNamed:@"f2"];
    
    _menuLabel1 =[[UILabel alloc]init];
    [_v1 addSubview:_menuLabel1];
    [_menuLabel1 sizeToFit];
    [_menuLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_img1.mas_bottom).offset(10);
        make.centerX.equalTo(_v1.mas_centerX);
    }];
    _menuLabel1.text=@"ddd";
    _menuLabel1.font =[UIFont systemFontOfSize:13];
    
    _v2 =[[UIView alloc]init];
    [baseView addSubview:_v2];
    [_v2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(baseView.mas_centerX).offset(40+5);
        make.top.equalTo(baseView.mas_top).offset(5);
        make.height.equalTo(@(80));
        make.width.equalTo(@(80));
    }];
    _v2.backgroundColor =[UIColor yellowColor];
    
    _img2 =[[UIImageView alloc]init];
    [_v2 addSubview:_img2];
    [_img2 sizeToFit];
    [_img2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(_v2.mas_centerX);
        make.top.equalTo(_v2.mas_top).offset(10);
        make.height.equalTo(@(25));
        make.width.equalTo(@(25));
    }];
    _img2.image =[UIImage imageNamed:@"f2"];
    
    _menuLabel2 =[[UILabel alloc]init];
    [_v2 addSubview:_menuLabel2];
    [_menuLabel2 sizeToFit];
    [_menuLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_img2.mas_bottom).offset(10);
        make.centerX.equalTo(_v2.mas_centerX);
    }];
    _menuLabel2.text=@"ddd";
    _menuLabel2.font =[UIFont systemFontOfSize:13];
    
    return baseView;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
